﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace OnATous.BusinessManagement
{
    public class User
    {
        DataAccess.User userDataAccess;

        public User()
        {
            userDataAccess = new DataAccess.User();
        }

        public bool createUser(string firstName, string lastName, string photo)
        {
            return userDataAccess.createUser(firstName, lastName, photo);
        }
        public bool createUser(DBO.User user)
        {
            return userDataAccess.createUser(user);
        }

        public bool UpdateUser(DBO.User user)
        {
            return userDataAccess.UpdateUser(user);
        }
        public DBO.User GetFriendToEval(DBO.User user, List<DBO.User> friends)
        {
            List<DBO.User> temp = friends;
            DBO.User friend = userDataAccess.GetFriendToEval(user, temp);
            if (friend != null)
                UpdateUser(friend);
            return friend;
        }

        public DBO.User GetUserById(Int64 id)
        {
            return userDataAccess.GetUserById(id);
        }
    }
}